101 Microsoft Visual Basic .NET Applications

Create a Screensaver with GDI+

This sample shows how to create a screen saver using Visual Basic .NET.

Featured Highlights:

This how-to demonstrates many of the important features of creating screen savers that can be automated by Windows. Concepts demonstrated are:

The screen-saver preview functionality is not demonstrated, since it involves several advanced threading issues.

Requirements:

Running the Sample:

To run the sample:
  1. Press F5.
  2. Click the Install button on the main form to copy the screen saver to the Windows system folder.
  3. Go into your display settings, and set the screen saver as 101 VB.NET Sample Applications Screen Saver.
  4. Test the screensaver.
  5. Explore the  GDI+ Screen Saver project for an example of how to create your own screen saver.

Notes:

When you compile your screen saver, there are several things to keep in mind. First, be sure to set the following Form Properties:

Before you can use a newly compiled screen saver, you must change its extension from .EXE to .SCR, and copy it to the Windows system directory (by default, in Windows XP, this is "C:\Windows\System32").